function checkAll(name, formid) {
  var elem = document.getElementById(formid).elements;

  for(var i = 0; i < elem.length; i++) {
    if(elem[i].type == "checkbox" && elem[i].name.indexOf(name) == 0) {
      elem[i].checked = true;
    }
  } 
}

function checkNone(name, formid) {
  var elem = document.getElementById(formid).elements;

  for(var i = 0; i < elem.length; i++) {
    if(elem[i].type == "checkbox" && elem[i].name.indexOf(name) == 0) {
      elem[i].checked = false;
    }
  } 
}

function popup_sizeable(url, width, height) {
  var left   = (screen.width  - width)/2;
  var top    = (screen.height - height)/2;
  var params = 'width='+width+', height='+height;
  params += ', top='+top+', left='+left;
  params += ', directories=no';
  params += ', location=no';
  params += ', menubar=no';
  params += ', resizable=no';
  params += ', scrollbars=yes';
  params += ', status=no';
  params += ', toolbar=no';
  newwin = window.open(url,'windowname5', params);
  if (window.focus) {
    newwin.focus()
  }
  
  return false;
}

function popup(url) {
  return popup_sizeable(url, 700, 400);
}

